Messi, who has struggled for form in recent weeks due to a niggling injury, looked on a mission to grab the winner and after twice coming close he completed his treble to put Barca ahead in the 85th minute, reacting quickly to a poor Sevilla clearance to dink the ball over goalkeeper Tomas Vaclik.
Harry Kane scored twice in his first league appearance in front of a home crowd to steer champions Bayern Munich to a 3-1 victory over Augsburg.
In the remote corner of eastern Bolivia where Che was executed, thousands gathered to commemorate his death anniversary.
Rayo Vallecano forward Alvaro Garcia netted an early goal to give his side a surprise 1-0 win against Barcelona at the Camp Nou on Sunday, moving Real Madrid another step closer to sealing their 35th LaLiga title.
A dominant yet wasteful Real ravaged their rivals in the first half while spurning a string of clear chances at the Santiago Bernabeu.
Barca lead the standings on 39 points from 18 games, three clear of second-placed Real Madrid who host Athletic Bilbao on Sunday.
A round-up of Wednesday's action in the UEFA Champions League.
Lionel Messi scored a 50th freekick goal for Barcelona as he led his side to a quick-fire comeback to win 3-2 at Valencia on Sunday and keep the pressure on La Liga title rivals Atletico Madrid and Real Madrid.
Images from Tuesday's action in the UEFA Champions League.
Images from the Champions League matches played across Europe on Tuesday
A round of Wednesday night's Champions League group stage matches.
Lionel Messi, Luis Suarez and Neymar combined to devastating effect as Barcelona swatted Celtic aside 7-0 at the Nou Camp to lay down a marker in Champions League Group C on Tuesday.
A summary of Wednesday's matches in the UEFA Champions League.
Images from the UEFA Champions League matches played across Europe on Wednesday